export interface UserVO {
  id: number
  userName: string
  nickName: string
  email: string
  avatar?: string
  phonenumber?: string
  sex: '0' | '1' | '2' // 0男，1女，2未知
  signature?: string
  status: '0' | '1' // 0正常 1停用
  userType: '0' | '1' // 0管理员，1普通用户
  createTime: string
  updateTime: string
}

export interface ArticleVO {
  id: number
  userId: number
  categoryId: number
  articleTitle: string
  articleContent: string
  articleIntroduction: string
  articleCover: string
  createTime: string
  updateTime: string | null
  liked: number
  unliked: number
  isLiked: number
  isUnliked: number
  isTop: number
  status: boolean
  type: boolean
  originalUrl: string
  coverImage?: string
  authorNickName: string
  authorAvatar: string
  authorSignature: string
}

export interface LoginRequest {
  userName: string
  password: string
  email?: string
  nickName?: string
  phonenumber?: string
}

export interface LoginResult {
  token: string
  roles: string[]
  tokenStatus: number
  refreshToken: string
}

export interface RegisterRequest extends LoginRequest {
  email: string
}

export interface Result<T> {
  code: number
  msg: string
  data: T
}

export interface PageVO<T> {
  currentIndex: number
  pageSize: number
  total: number
  totalPage: number
  data: T[]
}

export interface ArticleCreateRequest {
  articleTitle: string
  articleContent: string
  articleCover?: string
  articleIntroduction?: string
  categoryId: number
  originalUrl?: string
  status: boolean
  type: boolean
}

export interface ArticleQueryParams {
  current: number
  pageSize: number
  categoryId: number
}

export interface CategoryVO {
  id: number
  categoryName: string
  createTime: string | null
  updateTime: string | null
}

export interface UserInfoUpdateRequest {
  id: number
  avatar?: string
  email?: string
  nickName?: string
  phonenumber?: string
  sex?: '0' | '1' | '2'
  signature?: string
}

export interface CommentVO {
  id: number
  userId: number // 评论用户ID
  userNickName: string // 评论用户昵称
  userAvatar: string // 评论用户头像
  topicId: number // 评论主题ID
  commentContent: string // 评论内容
  parentId: number // 父评论ID
  replyUserId: number // 回复用户ID
  replyUserNickName: string // 回复用户昵称
  replyUserAvatar: string // 回复用户头像
  replyCount: number // 回复数量
  isReview: boolean // 是否审核
  createTime: string // 创建时间
  updateTime: string // 更新时间
}

// 评论添加请求参数
export interface CommentAddReq {
  commentContent: string
  isReview: boolean
  parentId?: number
  replyUserId?: number
  topicId: number
}

// 评论查询请求参数
export interface CommentQueryReq {
  pageIndex: number
  pageSize: number
  topicId?: number
  parentId?: number
  userId?: number
  replyUserId?: number
  isReview?: boolean
  queryReply?: boolean
}
